var hoildaybastic = function() {
	return {
		uploader : function() {
			var uploader = new qq.FineUploader(
					{
						element : document.getElementById('result-uploader'),
						request : {
							endpoint : 'uploadfile'
						},
						text : {
							uploadButton : '<i class="glyphicon glyphicon-plus"></i>上传文件'
						},
						template : '<div class="qq-uploader">'
								+ '<pre class="qq-upload-drop-area"><span>{dragZoneText}</span></pre>'
								+ '<div class="qq-upload-button btn btn-default btn-sm" style="background: #F6F6F6;border: 1px solid rgb(206, 206, 206);display: inline;top: 3px;padding: 5px 15px 7px 15px;width: 100%;position: relative;overflow: hidden;border-radius: 0;">{uploadButtonText}</div>'
								+ '<span class="qq-drop-processing" style="display:none"><span>{dropProcessingText}</span>'
								+ '<span class="qq-drop-processing-spinner"></span></span>'
								+ '<ul class="qq-upload-list" style="margin-top: 10px; text-align: center;display:none"></ul>'
								+ '</div>',
						classes : {
							success : 'alert alert-success',
							fail : 'alert alert-error'
						},
						callbacks : {
							onComplete : function(id, fileName, responseJSON) {
								if (responseJSON.type=='success') {
									var filepath = responseJSON.data;
									//createUploader.deletefile(filepath);
									createUploader.inputhours(filepath);
								}
							}
						}
					});
		},
		initSearch : function() {
			if (!jQuery().dataTable) {
				return;
			}
			var uListTable = $("#holidaylist").dataTable({
				"sAjaxSource" : ctx + "/bastic/searchholiday?now=" + new Date().getTime(),
				"bSort":true,
				"aaSorting": [[ 1, "desc" ]],
				/* 使用post方式 */
				"fnServerData" : function(sSource, aoData, fnCallback) {
					var postData = {page : 1,start : 0,rows : 10,params : {}};
					$.ajax({
						"dataType" : 'json',
						"cache": false,
						"type" : "POST",
						"url" : sSource,
						"data" : postData,
						"success" : function(data, textStatus, jqXHR){
							fnCallback(data.data, textStatus, jqXHR);
						}
					});
				},
				"bAutoWidth":false,
				"aoColumnDefs" : [
						
						{
							"data" : "index",
							"bSortable": false,
							"aTargets" : [ 0 ]
						},
						{
							"data" : "year",
							"aTargets" : [ 1 ]
						},
						{
							"data" : "create_time",
							"aTargets" : [ 2 ]
						},
						{
							"data" : "pdate_time",
							"aTargets" : [ 3 ]
						},
						{
							"data" : "month",
							"aTargets" : [ 3 ]
						},
						{
							"aTargets" : [ 5 ],
							"bSortable": false,
							"mRender" : function(data, type, full) {
								var btns ='';
								btns +=  Permission.createPermElement('user:list:modify',' <button title="'+messages.public_button_edit+'" class="btn btn-sm-table  btn-primary" name="edit" target_id="'+full.id+'">编辑</button>');
								btns +=  Permission.createPermElement('user:list:modifypassword',' <button title="重置密码" class="btn btn-sm-table  btn-primary" name="editPassword" target_id="'+full.id+'">重置密码</button>');
								btns +=  Permission.createPermElement('user:list:del',' <button title="'+messages.public_button_del+'" class="btn btn-sm-table  btn-danger" name="del" target_id="'+full.id+'">删除</button>');
								return btns;
							}
						} ]
			});
			this.datatable = uListTable;
		},
	}
}();


